package com.sitanyun.merchant.guide.presenter.impl;

import com.sitanyun.merchant.guide.model.impl.VrWebAModelImpl;
import com.sitanyun.merchant.guide.model.inter.IVrWebAModel;
import com.sitanyun.merchant.guide.presenter.callback.CallBack;
import com.sitanyun.merchant.guide.presenter.inter.IVrWebAPresenter;
import com.sitanyun.merchant.guide.view.inter.IVrWebAView;

public class VrWebAPresenterImpl implements IVrWebAPresenter {
    private IVrWebAView mIVrWebAView;
    private IVrWebAModel mIVrWebAModel;

    public VrWebAPresenterImpl(IVrWebAView aIVrWebAView) {
        mIVrWebAView = aIVrWebAView;
        mIVrWebAModel = new VrWebAModelImpl();
    }

    @Override
    public void getconsumerList(String scenid) {
        mIVrWebAModel.setconsumerList(scenid, new CallBack() {
            @Override
            public void onSuccess(Object response) {
                mIVrWebAView.response(response,IVrWebAView.RESPONSE_ONE);
            }

            @Override
            public void onError(Throwable t) {
                mIVrWebAView.response(t,IVrWebAView.RESPONSE_TWO);
            }
        });
    }

    @Override
    public void getdetail(String scenid) {
        mIVrWebAModel.setdetail(scenid, new CallBack() {
            @Override
            public void onSuccess(Object response) {
                mIVrWebAView.responsedetail(response,IVrWebAView.RESPONSE_ONE);
            }

            @Override
            public void onError(Throwable t) {
                mIVrWebAView.responsedetail(t,IVrWebAView.RESPONSE_TWO);
            }
        });
    }
}
